//--------------------------------------------------------------------------------------
// Global variables
//--------------------------------------------------------------------------------------
texture g_BaseTexture
<
	string fileName = "textures/SunTexture_2048.png";
>;

float    g_fTime;



//--------------------------------------------------------------------------------------
// Texture samplers
//--------------------------------------------------------------------------------------
sampler BaseTextureSampler = 
sampler_state
{
    Texture = <g_BaseTexture>;
    MipFilter = LINEAR;
    MinFilter = LINEAR;
    MagFilter = LINEAR;
};


//--------------------------------------------------------------------------------------
// Vertex shader output structure
//--------------------------------------------------------------------------------------
struct VS_OUTPUT
{
    float4 Position   : POSITION;
    float2 TextureUV  : TEXCOORD0;
};


/*
//--------------------------------------------------------------------------------------
// This shader computes standard transform (no lighting)
//--------------------------------------------------------------------------------------
VS_OUTPUT RenderSceneVS(float4 vPos : POSITION, 
                        float2 vTexCoord0 : TEXCOORD0)
{
    VS_OUTPUT Output;
	
    // Transform the position from object space to homogeneous projection space
    Output.Position = mul(vPos, g_mWorldViewProj);
    
    // Just copy the texture coordinate through
    Output.TextureUV = vTexCoord0; 
    
    return Output;    
}
*/

//--------------------------------------------------------------------------------------
// Pixel shader output structure
//--------------------------------------------------------------------------------------
struct PS_OUTPUT
{
    float4 RGBColor : COLOR0;
};


//--------------------------------------------------------------------------------------
// This shader outputs the pixel's color by modulating the texture's
//       color with diffuse material color
//--------------------------------------------------------------------------------------
PS_OUTPUT RenderScenePS(VS_OUTPUT In) 
{ 
    PS_OUTPUT Output;

    Output.RGBColor = 
		tex2D(BaseTextureSampler, In.TextureUV)*0.4 +
		tex2D(BaseTextureSampler, In.TextureUV+float2(g_fTime*0.01, -g_fTime*0.02)) * 0.3 +
		tex2D(BaseTextureSampler, In.TextureUV+float2(g_fTime*0.02, g_fTime*0.02)) * 0.3;
	
    return Output;
}


//--------------------------------------------------------------------------------------
// Renders scene to render target
//--------------------------------------------------------------------------------------
technique RenderSceneWithTextureNoLight
{
    pass P0
    {          
        //VertexShader = compile vs_2_0 RenderSceneVS();
        PixelShader  = compile ps_2_0 RenderScenePS();
    }
}
